<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../vue.js"></script>


</head>
<body>


<div id="app">

    <button v-on:click="display=!display">按钮</button>

    <div v-show="display">控制显示隐藏</div>

    <button v-on:click="miaov(4,$event)">按钮</button>


    <button v-on:click="miaov">控制显示隐藏</button>


</div>


<script>

    let vm=new Vue({

        el:'#app',
        data:{

            display:true,
        },

        methods:{//模板中使用的方法


            miaov(n,ev){

                console.log(n);
                console.log(ev);


            },

            miaov(){
                console.log(this);

                this.display=!this.display;
            }
        }
    });
</script>



</body>
</html>